package com.f5.management.service.imp;

import com.f5.management.dao.MemberDao;
import com.f5.management.entity.Member;
import com.f5.management.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

/**
 * @author author
 * @create 2021 -04 - -
 **/
@Service
public class MemberServiceImpl  implements MemberService {
      @Autowired
    MemberDao memberDao;

    @Override
    @Transactional
    public void add(Member member) {
       //判断成员表有无此成员，避免相同身份证,电话
        member.setCreateTime(new Date());
        memberDao.insertOne(member);
        if(1==member.getType()) {
            //查询房产表uid有没有被占用

            //执行改变房产表uid;
        }
        else{
            //租户
        }

    }

    /** 查询成员表数量
     * @return
     */
    @Override
    public int getMemberCount() {
        return 0;
    }

    @Override
    public Member selectMemberByIdCard() {
        return null;
    }

    @Override
    public boolean updateStatus(int id) {
        return false;
    }

    @Override
    public List<Member> selectMembersByPage(int page, int size) {
        return null;
    }
}
